<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>这是a页面</title>
</head>
<script src="//cdn.66173.cn/www/js/jquery-1.8.3.min.js"></script>
<body>
<input type="text" class="inpt" onchange="hunqu()" style="width: 300px;height: 40px"><label><a href="" class="chuanzhi" style="font-size: 40px">静态传值</a></label>

</body>
<script type="text/javascript"  src="getUrlParam.js"></script>
<script>
     function hunqu(){
         var ipt=$('.inpt').val();
         if(ipt==''||ipt==null){
             // window.location.href= window.location.href
             alert('输入不能为空')
         }else{
             $(".chuanzhi").attr("href","b.html?src=https://www.baidu.com/img/bd_logo1.png&name="+ipt);
         }
    }
     $(".chuanzhi").click(function () {
         var ipt=$('.inpt').val();
         if(ipt==''||ipt==null){
             alert('输入不能为空')
           // window.location.href= window.location.href
         }
     })
</script>
</html>